<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../node_modules/vue/dist/vue.global.js"></script>
</head>

<body>
    <div id="app">
        <input type="text" name="" id="" @keyup.esc='getvalue'>
        <input type="button" value="登录" @keyup.enter="loginFn">
    </div>
</body>

</html>
<script>
    // 按键修饰符
    // 定义: 修饰键盘事件的

    //         .tab
    //         .delete(捕获“Delete”和“Backspace”两个按键)
    //         .esc
    //         .space
    //         .up
    //         .down
    //         .left
    //         .right
    const app = Vue.createApp({
        data() {
            return {

            }
        },
        methods: {
            getvalue(e) {
                console.log(e.target.value);
            },
            loginFn() {
                console.log('登录');
            }

        }
    }).mount('#app')

</script>